<template>
  <div class="dashboard-container">
    <div class="dashboard-text">{{ name }}</div>
    <div class="container">
      <div class="card">
        <div
          class="card-cover"
          style="
            background-image: url(http://img.xiyblog.cn/%E5%AF%BC%E8%88%AA/%E7%B2%BE%E5%9B%BE/19.jpg);
          "
        ></div>
      </div>

      <div class="card">
        <div
          class="card-cover"
          style="
            background-image: url(http://img.xiyblog.cn/%E5%AF%BC%E8%88%AA/other/ot1%20%284%29.jpg);
          "
        ></div>
      </div>

      <div class="card">
        <div
          class="card-cover"
          style="
            background-image: url(http://img.xiyblog.cn/%E5%AF%BC%E8%88%AA/%E7%B2%BE%E5%9B%BE/23.jpg);
          "
        ></div>
      </div>

      <div class="card">
        <div
          class="card-cover"
          style="
            background-image: url(http://img.xiyblog.cn/%E5%AF%BC%E8%88%AA/other/ot1%20%281%29.jpg);
          "
        ></div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  name: "Dashboard",
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["name"]),
  },
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}

.dashboard-text {
  color: beige;
}

.dashboard-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to right top, #140a2d, #7d31d2);
  overflow: hidden;
  perspective: 1300px;
  height: 100vh;
  margin: 0;
  padding: 0;

}


.container {
  width: 100%;
  max-width: 1200px;

  display: flex;
}

.card {
  position: relative;
  flex: 1;
  height: 460px;
  /* border: 1px solid red; */
  margin: 0 20px;
  perspective: 1000px;
  /* border-radius: 50%; */
}

.card ::before {
  content: "";
  width: 90%;
  height: 90%;
  /* background-color: rgba(0, 0, 0, 0.5); */
  position: absolute;
  z-index: 99;
  left: 5%;
  top: 5%;
  /* box-shadow: 0 6px 12px 12px rgba(0, 0, 0, 0.4); */
  opacity: 1;
  transform-origin: top center;
  transition: 0.3s ease-in-out;
}

.card:hover ::before {
  opacity: 0.6;
  transform: rotateX(7deg) translateY(-6px) scale(1.05);
}

.card-cover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transform-style: preserve-3d;
  transform-origin: top center;
  transition: transform 0.35s ease-in-out;
  border-radius: 2%;
}

.card-cover::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 120%;
  background: linear-gradient(
    226deg,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: translateY(-100%);
  transition: transform 0.85s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover .card-cover {
  transform: rotateX(7deg) translateY(-6px);
}

.card:hover .card-cover::after {
  transform: translateY(100%);
}
</style>
